<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>21_鼠标事件-鼠标右键-单击-oncontextmenu</title>
        <style>
            div {
                width: 200px;
                height: 200px;
                background-color: aqua;
            }
        </style>
    </head>
    <body>
        <div></div>

        <script>

            var div = document.querySelector('div');
            div.oncontextmenu = function(){
                console.log(3333);
            }
           
            
        </script>
    </body>
</html>